﻿CREATE VIEW [steve].[uvSteve_SiteUrlLatest]
	AS 
	
SELECT u.SiteUrlId	
	, u.CreateDate
	, u.ExternalId
	, u.SystemName
	, u.LatestRevisionNumber
	, u.SiteName
	, u.Url
	, u.CreateMembershipId
	, ur.EndDate
	, ur.IsSecure
	, ur.IgnoreQueryString
	, ur.PageMetaDescription
	, ur.PageMetaKeywords
	, ur.PageTitle
	, ur.RevisionComment
	, ur.RevisionDate
	, ur.RevisionMembershipId
	, ur.StartDate

FROM steve.SiteUrl u
	inner join steve.SiteUrlRevision ur on ur.SiteUrlId = u.SiteUrlId and ur.RevisionNumber = u.LatestRevisionNumber